/*=============================================================================
#    The element-comm is a tentative program used to test our ideas.           
#                       Copyright (C)  bgao                                    
#
#     This program is free software; you can redistribute it and/or            
#      modify it under the terms of the GNU General Public License             
#     as published by the Free Software Foundation; either version 2           
#         of the License, or (at your option) any later version.               
#
#     This program is distributed in the hope that it will be useful,          
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            
#             GNU General Public License for more details.                    
#
#    You should have received a copy of the GNU General Public License        
#     along with this program; if not, write to the Free Software             
#      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,             
#                       MA  02110-1301, USA.                                  
#==============================================================================
# $Id$ 
#
# $Author$ 
#
# $Revision$ 
#
# $Date$ 
#
# Description: 
#
=============================================================================*/
#include    "rtos-wsn.h"
#include    "wsn-taskid.h"


extern int Wsn_AppTask(int);

extern int Wsn_ZigbeeTask(int);

extern int Wsn_ZigbeeInit(int);

extern int Wsn_EdfiTask_S1(int);
extern int Wsn_EdfiTask_S2(int);


extern int Wsn_TestTask1(int);
extern int Wsn_TestTask2(int);
extern int Wsn_TestTask3(int);


#ifdef _Debug_thread_
int Wsn_ZigbeeInit(int event)
{
	return event;
}
int Wsn_ZigbeeTask(int event)
{
	return event;
}
#endif

const struct wsn_task_section timer_task_sections[1] FLASH= {
    { Wsn_TimerTask, 0 },
};

const struct wsn_task_section app_task_sections[1] FLASH= {
    { Wsn_AppTask, 0 },
};

const struct wsn_task_section zigbee_task_sections[1] FLASH= {
    { Wsn_ZigbeeTask, 0 },
};

const struct wsn_task_section zigbee_init_task_sections[1] FLASH= {
    { Wsn_ZigbeeInit, 0 },
};

const struct wsn_task_section edfi_task_sections[2] FLASH= {
    	{Wsn_EdfiTask_S1, 0},
    	{Wsn_EdfiTask_S2, 0}
};


const struct wsn_task_section test_task1_sections[1] FLASH= {
    { Wsn_TestTask1, 0 },
};

const struct wsn_task_section test_task2_sections[1] FLASH= {
    { Wsn_TestTask2, 0 },
};

const struct wsn_task_section test_task3_sections[1] FLASH= {
    { Wsn_TestTask3, 0 },
};



const struct wsn_task_attr wsn_task_attr_list[] FLASH= {
    { TIMER_TASKID, /* task ID */
      1, /* Number of sections */
      80, /* Time to complete, one time tick is 80 clocks. one clock = 1 /(8MHz/32) */
      timer_task_sections },    
	{ APP_TASKID, 
	  1, 
      5000, 
      app_task_sections },     
    { ZIGBEE_TASKID, 
      1, 
      100000, 
	  zigbee_task_sections },
    { ZIGBEE_INITID, 
	  1, 
	  100000, 
	  zigbee_init_task_sections },
 	{ EDFI_TASKID, 
      2, 
      6000, 
      edfi_task_sections },
     { TEST_TASK1ID,
      1, 
      2000, 
      test_task1_sections },
     { TEST_TASK2ID,
      1, 
      9000,
      test_task2_sections },
     { TEST_TASK3ID, 
      1, 
      15000, 
      test_task3_sections },

    { 0 },
};
